package chapter21;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/25 13:58
 */
public class ClassDemo {
    public static void main(String[] args) {
        Class<Integer> integerClass = int.class;
        Class<Void> voidClass = void.class;
        Class<Comparable> cls = Comparable.class;

        /*System.out.println("simple name:" + integerClass.getSimpleName());
        System.out.println("name:" + integerClass.getName());
        System.out.println("canonical name:" + integerClass.getCanonicalName());*/

        List<Class<?>> classes = new ArrayList<>();
        classes.add(int.class);
        classes.add(int[].class);
        classes.add(int[][].class);
        classes.add(String.class);
        classes.add(String[].class);
        classes.add(HashMap.class);
        classes.add(Map.Entry.class);

        for (Class<?> aClass : classes) {
            System.out.println("simple name:" + aClass.getSimpleName());
            System.out.println("name:" + aClass.getName());
            System.out.println("canonical name:" + aClass.getCanonicalName());
            System.out.println("package:" + aClass.getPackage());
            System.out.println("------------------------");
        }

    }
}
